<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head> 

<body>
    <div class="box">
        <p> <input type="text" value="北京市" class="input"> </p>
        <p> <input type="text" value="朝阳区" class="input"> </p>
        <p><button class="cc">传参</button></p>
    </div> 
</body>
<script>
    var cc = document.querySelector(".cc")
    var input = document.querySelectorAll(".input")
    cc.onclick = function () {
        for (var i = 0; i < input.length; i++) {
            alert(input[i].value) 
        }
    }






</script>

</html>
<style>
    .box {
        text-align: center;
    }
</style>